package com.config;

import com.controller.HelloController;
import com.jfinal.config.*;
import com.jfinal.server.undertow.UndertowServer;
import com.jfinal.template.Engine;

public class MyConfig extends com.jfinal.config.JFinalConfig{
    public static void main(String[] args) {

        UndertowServer.create(MyConfig.class).configWeb(builder->{

            // 配置 WebSocket，MyWebSocket 需使用 ServerEndpoint 注解
            builder.addWebSocketEndpoint("com.websocket.MyWebSocket");
        }).start();
    }

    public void configConstant(Constants me) {
        me.setDevMode(true);
    }

    public void configRoute(Routes me) {
        me.add("/", HelloController.class);
    }

    public void configEngine(Engine me) {}
    public void configPlugin(Plugins me) {}
    public void configInterceptor(Interceptors me) {}
    public void configHandler(Handlers me) {}
}
